using System;
using System.Collections.Generic;
using System.ByteBuffer;
using tools;

namespace Zjh
{
    /// <summary>
    /// generate by msg tool
    /// 比牌结果
    /// </summary>
	public class ResVersusMsg : ResMessage
	{
		//0:输,非0:赢
		public int win;
		//主动比牌玩家id
		public long playerId;
		//被比牌玩家id
		public long vsPlayerId;
		//下一个操作玩家id(0表示没有)
		public long nextOptPlayerId;

        public ResVersusMsg() { }

        public ResVersusMsg(int win, long playerId, long vsPlayerId, long nextOptPlayerId)
        {
            this.win = win;
            this.playerId = playerId;
            this.vsPlayerId = vsPlayerId;
            this.nextOptPlayerId = nextOptPlayerId;
        }

        
		public void write(object obj)
		{
            ByteBuffer b = obj as ByteBuffer;
			b.PushInt(win);
			b.PushLong(playerId);
			b.PushLong(vsPlayerId);
			b.PushLong(nextOptPlayerId);
			
		}

	    public void read(object obj)
		{
            MyConverter b = obj as MyConverter;
			win = b.toInt32();
			playerId = b.toInt64();
			vsPlayerId = b.toInt64();
			nextOptPlayerId = b.toInt64();
			
		}

		public int Id
		{
            get { return 519227; }
		}

        public String Desc
        {
            get { return "比牌结果"; }
        }
	}
}